package com.camus.framework.common;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class CommonResult<T> {

	private int code;
	private String msg;
	private T data;

	public static <T> CommonResult<T> succ(T data) {
		CommonResult<T> result = new CommonResult<>();
		result.setData(data);
		return result;
	}

	public static CommonResult<?> fail(int code, String msg) {
		CommonResult<?> result = new CommonResult<>();
		result.setCode(code);
		result.setMsg(msg);
		return result;
	}

}
